Skip to content

Detect and locate VRChat and Proton out of the box#9

Open
hypevhs wants to merge 1 commit into
BefuddledLabs:mainfrom
hypevhs:hype-revamp
Open

Detect and locate VRChat and Proton out of the box#9
hypevhs wants to merge 1 commit into
BefuddledLabs:mainfrom
hypevhs:hype-revamp

Conversation

@hypevhs
Copy link
Copy Markdown

@hypevhs hypevhs commented Apr 26, 2026

We're doing it "the right way". It autodetects your preferred Proton from Steam, locates the compatdata and LocalLow dirs, locates VRChat installation dir from Steam, if unset, allows you to set a custom VRChat.exe and/or a custom proton version, the Harmony patches are a bit cleaner organized, there's a lot of logging and defensive error handling, nullable context is on, almost supports multiple test clients, and has lots of docs.

But it is huge, sorry. I did write it by hand tho.

Fixes #1 and #8.

@DeltaNeverUsed
Copy link
Copy Markdown
Member

This is going to take me a while to review, sorry about that.

almost supports multiple test clients

Also, could you clarify this?
The patch as it is now, supports multiple test clients

"description": "Patches the VRChat Avatars SDK to work properly on Linux.",
"vpmDependencies": {
"com.vrchat.avatars": "^3.8.2",
"com.vrchat.avatars": "^3.10.3",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Bumping the VRC SDK version required here?
If not, I'd prefer it not be bumped

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bumped VRCSDK in response to this, but I misremembered the details:

https://ask.vrchat.com/t/developer-update-23-october-2025/46983#p-85382-a-reminder-to-upgrade-to-the-latest-sdk-3

VRC now requires SDK 3.9.0+ on newly-uploaded avatars, but I forgot the conditional words on that: newly, uploaded, and avatars. But beyond that, I have not tested old SDKs so the patches may or may not apply. If you'd like, we can un-bump, and cross that bridge when we come to it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer not to bump if the patches work for older versions of the SDK, but bumping to 3.9.0 would be okay

@hypevhs
Copy link
Copy Markdown
Author

hypevhs commented Apr 28, 2026

almost supports multiple test clients

Also, could you clarify this? The patch as it is now, supports multiple test clients

If I build-and-test with 2 clients, both windows come up, but the second one stays black, even after closing the first. Maybe a fluke or PEBCAK, I don't know.

@hypevhs
Copy link
Copy Markdown
Author

hypevhs commented May 22, 2026

Is the problem with this PR is that it's so large or monolithic? If it's the latter, I could try to break it up a little more, but then again it does rewrite just about everything... What should be done?

@DeltaNeverUsed
Copy link
Copy Markdown
Member

I just need to pull myself together to review the whole thing, it's just been a bit daunting.
I'll set aside some time tomorrow to hopefully get it done

Copy link
Copy Markdown
Member

@DeltaNeverUsed DeltaNeverUsed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, great work!
Sorry it's taken me forever to get around to this

private static void OnGUIRowCustomProton()
{
var customProtonPath = LinuxVrcEditorPrefs.CustomProtonPath;
EditorGUILayout.LabelField("Custom Proton: ", customProtonPath ?? "");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment saying that it'll auto-detect the path when blank or some way of saying it's allowed to be empty.

Comment on lines +57 to +58
var steamRoot = SteamLocator.FindSteamRoot();
if (steamRoot == null || !SteamLocator.IsValidSteamRoot(steamRoot))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var steamRoot = SteamLocator.FindSteamRoot();
if (steamRoot == null || !SteamLocator.IsValidSteamRoot(steamRoot))
var steamRoot = SteamLocator.FindSteamRoot();
if (steamRoot == null)

Why check twice here?
SteamLocator.FindSteamRoot already runs SteamLocator.IsValidSteamRoot

Comment on lines +265 to +274
// Q: the "internal name" inside "compatibilitytool.vdf"?
// A: I think so! This is as expected in all my Proton versions.
// The file "toolmanifest.vdf" has nothing relevant.

return (from toolDir in Directory.GetDirectories(toolsDir)
let compatToolVdfPath = Path.Combine(toolDir, "compatibilitytool.vdf")
where File.Exists(compatToolVdfPath)
let compatToolVdfContents = File.ReadAllText(compatToolVdfPath)
// I could parse this file, but why bother lol
where compatToolVdfContents.Contains(compatToolName)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also ends up matching "display_name" which is desirable here.
Adding that to the comment above would be nice

namespace BefuddledLabs.LinuxVRChatSdkPatch.Base.Editor.Locators
{
/// <summary>
/// Data extracted from appcache.vdf on 2026-04-17 using a one-off script using new-vdf-parser[1]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean appinfo.vdf?

Comment on lines +9 to +48
public static class OfficialCompatToolData
{
private static readonly CompatTool Proton9 = new(
"proton_9",
"2805730",
"proton-9.0-4pin".Split(","),
"Proton 9.0 (Beta)"
);

private static readonly CompatTool Proton10 = new(
"proton_10",
"3658110",
"proton-9,proton-9.0-1RC,proton-stable,proton-next,proton_next,proton-7.0-1,proton-7.0-2,proton-7.0-3,proton-7.0-4,proton-7.0-5,proton-7.0-6,proton-8.0-1,proton-8.0-2,proton-8.0-3,proton-8.0-4,proton-8.0-5,proton-8.0RC,proton-9.0-2RC,proton-9.0-3RC,proton-9.0-4RC,proton-10,proton-10.0-beta,proton-10.0-3RC"
.Split(","),
"Proton 10.0"
);

private static readonly CompatTool Proton11 = new(
"proton_11",
"4628710",
"proton-11.0-beta".Split(","),
"Proton 11.0"
);

private static readonly CompatTool ProtonHotfix = new(
"proton_hotfix",
"2180100",
"proton-hotfix".Split(","),
"Proton Hotfix"
);

private static readonly CompatTool ProtonExperimental = new(
"proton_experimental",
"1493710",
"proton-experimental".Split(","),
"Proton - Experimental"
);

public static readonly CompatTool[] All = { Proton9, Proton10, Proton11, ProtonHotfix, ProtonExperimental };
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a request to change anything.
Preferably this wouldn't be hardcoded, but parsing that file would be quite annoying.

Comment thread README.md
- Fixes the Build and Test button, allowing for multiple clients to test a world in offline mode.
- Adds some UI in VRCSDK Settings tab to select a different Proton to use instead of what's set in Steam.
- Show a one-time dialog to ask for votes on the Canny for Linux support.
- Add debugging helpers to the **Tools &rarr; Linux VRChat SDK Patch** menu.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this worth pointing out as a feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't test multiple clients

2 participants